package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2023-07-13
 * Time: 14:28
 */
public class ThreadDemo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            for (int i = 0; i < 10000000; i++) {
                //这个循环体啥都不干
            }
        });
        //启动之前，获取 t 状态，就是 NEW 状态
        System.out.println("start之前" + t.getState());
        t.start();
        System.out.println("t执行中的状态" + t.getState());
        t.join();
        //线程执行完毕之后，就是 TERMINATED 状态
        System.out.println("start之后" + t.getState());
    }
}
